﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace leetcode
{
    public class Solution
    {
        public  int[] TwoSum(int[] nums, int target)
        {
            for (int i = 0; i < nums.Length; i++)
            {
                for (int j = i + 1; j < nums.Length; j++)
                {
                    if (nums[i] + nums[j] == target)
                    {
                        return new int[] { i, j };
                    }
                }
            }
            return null;
        }


        public IList<IList<string>> GroupAnagrams(string[] strs){
           return strs.GroupBy(s => new string(s.OrderBy(c => c).ToArray())).Select(g => g.ToArray()).ToArray();
           
        }
    }
}
